<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--jstl을 쓰기 위해 사용 --%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><%--숫자 포맷을 사용하기 위해 사용 --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%><%--함수들을 이용하기 위해 사용 --%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- 달력 관련 css, js -->
<link rel='stylesheet' href='calendar/calendar_ahmax.css' type='text/css' />
<script src="calendar/jquery-1.4.4.min.js"></script>
<script src="calendar/jquery.mousewheel.min.js"></script>
<script src="calendar/calendar_ahmax.js"></script>

<link rel="stylesheet" href="css/style.css" type="text/css"></link>
<script type="text/javascript" src="script/sms_util_script.js"></script>
<!--<script type="text/javascript" src="script/sms_asset_script.js"></script>-->
<script type="text/javascript">
//js파일로 넣으면 el,jstl값을 못읽어옴
//자산유형별 추가 테이블 변경 스크립트
function changeAddTable(assetBaseListSize){
	var size=parseInt(assetBaseListSize);
	var assetNo=document.getElementById("asset_no").value;
	var divControl=document.getElementById(assetNo);
	document.getElementById(assetNo).style.display="";
	for(i=1;i<=size;i++){
		if(assetNo!=i){
			document.getElementById(i).style.display="none";
			document.getElementById(i).innerHTML="";
		}
	}
	if(assetNo==1 || assetNo==2){
		divControl.innerHTML="<table class='tb06' border='0' cellpadding='0' cellspacing='1'>"
				+"<tr height='30px'>"
					+"<th class='cal' rowspan='4' width='60px'>추가사항</th>"
					+"<th width='80px' align='center' class='cal'>목적/기능</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_goal' id='a_goal' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_goal}' maxlength='15'></input>"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>제품명</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_prod' id='a_prod' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_prod}' maxlength='20'></input>"
					+"</td>"
				+"</tr>"
				+"<tr height='30px'>"
					+"<th width='80px' align='center' class='cal'>서비스 범위</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_service' id='a_service' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_service}' maxlength='15'></input>"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>사용 OS</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_os' id='a_os' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_os}' maxlength='15'></input>"
					+"</td>"
				+"</tr>"
				+"<tr height='30px'>"
					+"<th width='80px' align='center' class='cal'>제조업체</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_make' id='a_make' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_make}' maxlength='15'></input>	"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>호스트명</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_host' id='a_host' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_host}' maxlength='15'></input>"
					+"</td>"
				+"</tr>"
				+"<tr height='30px'>"
					+"<td colspan='2'></td>"
					+"<th width='80px' align='center' class='cal'>IP</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_ip' id='a_ip' style='IME-MODE: disabled; border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_ip}' maxlength='15'onKeyDown='evKey(event)'  onkeyup='inputCheckSpecial(this)'></input>"
					+"</td>"
				+"</tr>"
			+"</table>";
	}else if(assetNo==3){
		divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
			+"<tr height='30px'>"
				+"<th class='cal' rowspan='4' width='60px'>추가사항</th>"
				+"<th width='80px' align='center' class='cal'>목적/기능</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_goal' id='a_goal' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_goal}' maxlength='15'></input>"
				+"</td>"
				+"<th width='80px' align='center' class='cal'>제품명</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_prod' id='a_prod' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_prod}' maxlength='20'></input>"
				+"</td>"
			+"</tr>"
			+"<tr height='30px'>"
				+"<th width='80px' align='center' class='cal'>펌 웨어 버전</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_firm' id='a_firm' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_firm}' maxlength='15'></input>"
				+"</td>"
				+"<th width='80px' align='center' class='cal'>사용 OS</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_os' id='a_os' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_os}' maxlength='15'></input>"
				+"</td>"
			+"</tr>"
			+"<tr height='30px'>"
				+"<th width='80px' align='center' class='cal'>제조업체</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_make' id='a_make' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_make}' maxlength='15'></input>	"
				+"</td>"
				+"<th width='80px' align='center' class='cal'>호스트명</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_host' id='a_host' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_host}' maxlength='15'></input>"
				+"</td>"
			+"</tr>"
			+"<tr height='30px'>"
				+"<td colspan='2'></td>"
				+"<th width='80px' align='center' class='cal'>IP</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_ip' id='a_ip' style='IME-MODE: disabled; border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_ip}' maxlength='15'onKeyDown='evKey(event)'  onkeyup='inputCheckSpecial(this)'></input>"
				+"</td>"
			+"</tr>"
		+"</table>";
	}else if(assetNo==4){
		divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
				+"<tr height='30px'>"
					+"<th class='cal' rowspan='2' width='60px'>추가사항</th>"
					+"<th width='80px' align='center' class='cal'>목적/기능</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_goal' id='a_goal' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_goal}' maxlength='15'></input>"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>현업/개발</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_devel' id='a_devel' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_devel}' maxlength='15'></input>"
					+"</td>"
				+"</tr>"
				+"<tr height='30px'>"
					+"<td colspan='2'></td>"
					+"<th width='80px' align='center' class='cal'>인증방식</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_ipin' id='a_ipin' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_ipin}' maxlength='15'></input>"
					+"</td>"
				+"</tr>"
			+"</table>";
	}else if(assetNo==5){
			divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
				+"<tr height='30px'>"
					+"<th class='cal' width='60px'>추가사항</th>"
					+"<th width='80px' align='center' class='cal'>목적/기능</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_goal' id='a_goal' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_goal}' maxlength='15'></input>"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>제조업체</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_make' id='a_make' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_make}' maxlength='15'></input>"
					+"</td>"
				+"</tr>"
			+"</table>";
	}else if(assetNo==6){
			divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
				+"<tr height='30px'>"
					+"<th class='cal' rowspan='2' width='60px'>추가사항</th>"
					+"<th width='80px' align='center' class='cal'>목적/기능</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_goal' id='a_goal' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_goal}' maxlength='15'></input>"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>사용OS</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_os' id='a_os' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_os}' maxlength='15'></input>"
					+"</td>"
				+"</tr>"
				+"<tr height='30px'>"
					+"<td colspan='2'></td>"
					+"<th width='80px' align='center' class='cal'>해당팀</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_team' id='a_team' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_team}' maxlength='15'></input>"
					+"</td>"
				+"</tr>"
			+"</table>";
	}else if(assetNo==7){
			divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
				+"<tr height='30px'>"
					+"<th class='cal' rowspan='2' width='60px'>추가사항</th>"
					+"<th width='80px' align='center' class='cal'>목적/기능</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_goal' id='a_goal' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_goal}' maxlength='15'></input>"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>제/개정 일자</th>"
					+"<td align='left' width='150px'>"
					+"<input type='text' name='a_kdate' id='a_kdate' style='IME-MODE: disabled; border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_kdate}' maxlength='10' onKeyDown='evKeyAndDot(event)'  onkeyup='inputCheckSpecial(this)'></input>"
					+"</td>"
				+"</tr>"
				+"<tr height='30px'>"
					+"<th width='80px' align='center' class='cal'>보존연한</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_save' id='a_save' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_save}' maxlength='20'></input>"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>보관서버<br/>(독립서버)</th>"
					+"<td align='left'  width='150px'>"
					+"<input type='text' name='a_singlesrv' id='a_singlesrv' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_singlesrv}' maxlength='20'></input>"
					+"</td>"
				+"</tr>"
			+"</table>";
			initCal("a_kdate");
	}else if(assetNo==8){
		divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
			+"<tr height='30px'>"
				+"<th class='cal' rowspan='3' width='60px'>추가사항</th>"
				+"<th width='80px' align='center' class='cal'>이름</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_name' id='a_name' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_name}' maxlength='15'></input>"
				+"</td>"
				+"<th width='80px' align='center' class='cal'>소속</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_company' id='a_company' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_company}' maxlength='20'></input>"
				+"</td>"
			+"</tr>"
			+"<tr height='30px'>"
				+"<th width='80px' align='center' class='cal'>직책/직급</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_job' id='a_job' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_job}' maxlength='15'></input>"
				+"</td>"
				+"<th width='80px' align='center' class='cal'>담당업무</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_takejob' id='a_takejob' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_takejob}' maxlength='20'></input>"
				+"</td>"
			+"</tr>"
			+"<tr height='30px'>"
				+"<td colspan='2'></td>"
				+"<th width='80px' align='center' class='cal'>부서장</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_subking' id='a_subking' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_subking}' maxlength='15'></input>"
				+"</td>"
			+"</tr>"
		+"</table>";
	}else if(assetNo==9){
		divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
			+"<tr height='30px'>"
				+"<th class='cal' rowspan='2' width='60px'>추가사항</th>"
				+"<th width='80px' align='center' class='cal'>제조업체</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_make' id='a_make' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_make}' maxlength='15'></input>"
				+"</td>"
				+"<th width='80px' align='center' class='cal'>수량</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_pcnt' id='a_pcnt' style='IME-MODE: disabled; border:#bfbfbf 1px solid; background-color: #ffffff;' maxlength='4' size='4'  onKeyDown='evKey(event)'  onkeyup='inputCheckSpecial(this)' value='${ovo.a_pcnt}'></input>"
				+"</td>"
			+"</tr>"
			+"<tr height='30px'>"
				+"<td colspan='2' width='230px'></td>"
				+"<th width='80px' align='center' class='cal'>도입 년월일</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_sdate' id='a_sdate' style='IME-MODE: disabled; border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_sdate}' maxlength='10' onKeyDown='evKeyAndDot(event)'  onkeyup='inputCheckSpecial(this)'></input>"
				+"</td>"
			+"</tr>"
		+"</table>";
		initCal("a_sdate");
	}else if(assetNo==10){
		divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
			+"<tr height='30px'>"
				+"<th class='cal' width='60px'>추가사항</th>"
				+"<td colspan='2' width='231px'></td>"
				+"<th width='80px' align='center' class='cal'>기밀등급</th>"
				+"<td align='left'  width='150px'>"
				+"<input type='text' name='a_security' id='a_security' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value='${ovo.a_security}' maxlength='20'></input>"
				+"</td>"
			+"</tr>"
		+"</table>";
	}else{
		//자산유형 10개까지만 테이블 만들었음
		divControl.innerHTML="";
	}
}
</script>
</head>
<body onload="javascript: changeAddTable('${fn:length(assetBaseList)}')";>
	<table width="100%"  border="0" cellspacing="0" cellpadding="0">
		<tr>
			<th bgcolor="#cff8ff" valign="center" height="40px" align="center"><font size="4">자산 식별</font></th>
		</tr>
		<tr>
			<td height="15px"></td>
		</tr>
		<tr>
		<!-- 내용 테이블 -->
		<td align="center">
				<form action="assetAction.do" method="post" name="assetIdenty">
				 <!-- 조건문 시작 -->
					<c:choose>
					<c:when test="${requestScope.update=='Y'}">
						<input type="hidden" name="mode" value="assetIdenty_update"></input>
					</c:when>
					<c:otherwise>
					 	<input type="hidden" name="mode" value="assetIdenty_insert"></input>
					</c:otherwise>									
					</c:choose>				
					<table class="tb06" border="0" cellpadding="0" cellspacing="1" >
						<tr height="30px">
							<th class="cal" rowspan="5" width='60px'>기본사항</th>
							<th width="80px" align="center" class="cal">자산유형</th>
							<td align="left" width="150px">
							 <!-- 조건문 시작 -->
							<c:choose>
							<c:when test="${requestScope.update=='Y'}">
								<select name="asset_no" id="asset_no" class="selectBox"  onchange="javascript: changeAddTable('${fn:length(assetBaseList)}')">
									<option value="${requestScope.assetNo }" selected="selected">${requestScope.asset_kind }</option>
								</select>
							</c:when>
							<c:otherwise><!--  else와 동일 -->
								<select name="asset_no" id="asset_no" class="selectBox"  onchange="javascript: changeAddTable('${fn:length(assetBaseList)}')">
								<c:forEach  var="aBaseList" items="${requestScope.assetBaseList}" varStatus="status">
											<!-- 단일 if 문 -->
									<option <c:if test="${aBaseList.asset_no == 1}">selected="selected" </c:if> value="${aBaseList.asset_no }">${aBaseList.asset_kind }</option>
								</c:forEach>
								</select>
							</c:otherwise>
							</c:choose>	
							<!-- 조건문 끝 -->		
							</td>
							<td align="right" colspan="2">
								<table border="0" cellspacing="0" cellpadding="0">
									<tr>
										 <td class="notline"><a href="#" onclick="javascript: assetWrite('assetIdenty')"><img src="img/save_btn.jpg" /></a></td>
										  <td class="notline"><a href="#" onclick="javascript: cancleWrite('assetIdenty_list')"><img src="img/cancel.gif" /></a></td>
									</tr>
								</table>								
							</td>
						</tr>
						<tr height="30px">
							<th width="80px" align="center" class="cal">자산코드</th>
							<td align="left">
							<!-- 조건문 시작 -->
								<c:choose>
								<c:when test="${requestScope.update=='Y'}">
									<input type="text" name="a_cd" id="a_cd" style="border:#bfbfbf 1px solid; background-color: #ffffff;" value="${avo.a_cd }" readonly="readonly"></input>
								</c:when>
								<c:otherwise><!--  else와 동일 -->
								 	<input type="text" name="a_cd" id="a_cd" style="border:#bfbfbf 1px solid; background-color: #ffffff;" onblur="javascript: searchAcd(this)" maxlength="15"></input>
								</c:otherwise>									
								</c:choose>	
								<!-- 조건문 끝 -->								
							</td>
							<th width="80px" align="center" class="cal">컨테이너</th>
							<td align="left"  width="150px">
								<input type="text" name="a_con" id="a_con" style="border:#bfbfbf 1px solid; background-color: #ffffff;" value="${avo.a_con }" maxlength="15"></input>		
							</td>
						</tr>
						<tr height="30px">
							<th width="80px" align="center" class="cal">자산명</th>
							<td align="left">																																																																										
								<input type="text" name="a_nm" id="a_nm" style="border:#bfbfbf 1px solid; background-color: #ffffff;" value="${avo.a_nm }" maxlength="20"></input>
							</td>
							<th width="80px" align="center" class="cal">소유자</th>
							<td align="left">
								<input type="text" name="a_owner" id="a_owner" style="border:#bfbfbf 1px solid; background-color: #ffffff;" value="${avo.a_owner }" maxlength="15"></input>		
							</td>							
						</tr>
						<tr height="30px">
							<th width="80px" align="center" class="cal">수량</th>
							<td align="left">																																																												<!-- 특문체크&숫자만입력가능 -->		
								<input type="text" name="a_cnt" id="a_cnt" style="IME-MODE: disabled; border:#bfbfbf 1px solid; background-color: #ffffff;" onKeyDown='javascript: evKey(event);'  onkeyup="javascript: inputCheckSpecial(this);" value="${avo.a_cnt }"></input>
							</td>
							<th width="80px" align="center" class="cal">관리자</th>
							<td align="left">
								<input type="text" name="a_admin" id="a_admin" style="border:#bfbfbf 1px solid; background-color: #ffffff;" value="${avo.a_admin }" maxlength="15"></input>		
							</td>
						</tr>
						<tr>
							<th width="80px" align="center" class="cal">자산위치</th>
							<td align="left">																
								<input type="text" name="a_loc" id="a_loc" style="border:#bfbfbf 1px solid; background-color: #ffffff;" value="${avo.a_loc }" maxlength="15"></input>
							</td>
							<th width="80px" align="center" class="cal">업무프로세스</th>
							<td align="left">
								<select name="job_no" id="job_no" class="selectBox">
								<c:forEach  var="jobProcessList" items="${requestScope.jobProcessList}" varStatus="status">
									<option <c:if test="${jobProcessList.job_no == requestScope.jobNo }">selected</c:if> value="${jobProcessList.job_no }">${jobProcessList.job_process }</option>
								</c:forEach>
								</select>								
							</td>
						</tr>	
						<tr>
							<td class="nopad" height="5px" bgcolor="green" colspan="5"></td>
						</tr>
					</table>
				<c:forEach var="i" begin="1" end="${fn:length(assetBaseList)}">
					<div id="${i }" style="display:"></div>
				</c:forEach>					
				</form>
			</td>
		</tr>
	</table>
</body>
</html>